import os
import unittest
import pytest
from Tools.TestHTTPRequest import TestHTTPRequests
from Tools import get_path
# from Test_Result.HwTestReport_local import HTMLTestReport
#
# # 运行实例
# suite = unittest.TestSuite()
# #通过TestLoader实例化
# loader = unittest.TestLoader()
# # 传方法名执行对应用例
# # suite.addTest(TestHTTP('test_api'))
# #通过loader类方法自动发现用例
# #这里使用模块名来导入，所以from导入模块的时候不能通过类名， 必须是模块文件名
# suite.addTest(loader.loadTestsFromTestCase(TestHTTPRequests))
#
#
# with open(get_path.test_report_path, 'wb') as file:
#     runner = HTMLTestReport.HTMLTestReport(
#         stream=file,
#         title='DDT+参数化+用例路径配置+测试报告路径配置+项目地址配置+超继承',
#         description='NMB测试报告',
#         tester='沃德发'
#     )
#     runner.run(suite)


#allure
# pytest.main(['./tests','-sv', '--alluredir', 'reports/temp_jsonreport'])
pytest.main(['./tests'])
# os.system("allure generate reports/temps -o  reports/allures --clean")
os.system(f"allure generate -o ./reports -c temps")
